home *** CD-ROM | disk | FTP | other *** search
- Path: EU.net!sun4nl!xs4all!falstaff
- From: falstaff@xs4all.nl (Falstaff)
- Newsgroups: comp.lang.c
- Subject: Re: Q about the float point format......
- Date: 19 Mar 1996 14:51:19 GMT
- Organization: XS4ALL, networking for the masses
- Message-ID: <4imhl7$jcf@news.xs4all.nl>
- References: <s3032089.15.314E68DD@sparc13.ncu.edu.tw>
- NNTP-Posting-Host: xs1.xs4all.nl
- X-Newsreader: NN version 6.5.0 #666 (NOV)
-
- s3032089@sparc13.ncu.edu.tw (Alexander PeaceLand) writes:
-
-
- > Could I dynamicly set the digits after the float POINT?
-
- > In other word... I use printf to print the float point number
- > like 123.456789 but in the other time i only
- > want to print 123.456 or 123.4
- > How shall I do? Thanks! :)
-
- i=3; /* or whatever */
- printf("%.*f",123.456789,i);
-
- That should work.
-
- Frank
- --
- The famous GIICM now on line: http://www.xs4all.nl/~falstaff/GIICM.html
- ------------------------------------------------------------------------
- Frank A. Vorstenbosch +31-(70)-355 5241 falstaff@xs4all.nl
-